import os


class Config:
    # SQLAlchemy
    # 使用环境变量
    # vim ~/.bashrc
    # export SQLALCHEMY_DATABASE_URI='mysql+pymysql://root:root@localhost/flaskdb'  # 用户名和密码都是root
    # export SQLALCHEMY_TRACK_MODIFICATIONS=False

    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@localhost/flaskdb'  # 用户名和密码都是root
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # flask-mail
    # MAIL_SERVER = 'smtp.126.com'
    # MAIL_PORT = 25
    # MAIL_USE_TLS = True
    # MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    # MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')

    # session, flash, flask_login
    SECRET_KEY = os.environ.get('SECRET_KEY') or '1761ca4a76862a97911f42eca428967208a739a849c33f88'


class DevConfig(Config):
    # flask-mail
    MAIL_SERVER = 'smtp.126.com'
    MAIL_PORT = 25
    MAIL_USE_TLS = True
    MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
